/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "grupo")
@NamedQueries({
    @NamedQuery(name = "Grupo.findAll", query = "SELECT g FROM Grupo g"),
    @NamedQuery(name = "Grupo.findByNGrpId", query = "SELECT g FROM Grupo g WHERE g.nGrpId = :nGrpId"),
    @NamedQuery(name = "Grupo.findByVNombre", query = "SELECT g FROM Grupo g WHERE g.vNombre = :vNombre"),
    @NamedQuery(name = "Grupo.findByVEstado", query = "SELECT g FROM Grupo g WHERE g.vEstado = :vEstado")})
public class Grupo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nGrpId")
    private Integer nGrpId;
    @Column(name = "vNombre")
    private String vNombre;
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(mappedBy = "nGrpId")
    private List<Docentexclase> docentexclaseList;

    public Grupo() {
    }

    public Grupo(Integer nGrpId) {
        this.nGrpId = nGrpId;
    }

    public Integer getNGrpId() {
        return nGrpId;
    }

    public void setNGrpId(Integer nGrpId) {
        this.nGrpId = nGrpId;
    }

    public String getVNombre() {
        return vNombre;
    }

    public void setVNombre(String vNombre) {
        this.vNombre = vNombre;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Docentexclase> getDocentexclaseList() {
        return docentexclaseList;
    }

    public void setDocentexclaseList(List<Docentexclase> docentexclaseList) {
        this.docentexclaseList = docentexclaseList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nGrpId != null ? nGrpId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Grupo)) {
            return false;
        }
        Grupo other = (Grupo) object;
        if ((this.nGrpId == null && other.nGrpId != null) || (this.nGrpId != null && !this.nGrpId.equals(other.nGrpId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Grupo[ nGrpId=" + nGrpId + " ]";
    }
    
}
